#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>

struct TreeNode {
	int val;
	struct TreeNode* left;
	struct TreeNode* right;
};


int flag = 0;

int* inorderTraversal(struct TreeNode* root, int* returnSize) {
    if (root == NULL)
    {
        if (flag == 0)
        {
            *returnSize = 0;
            int* ret = (int*)malloc(1 * sizeof(int));
            return ret;
        }
        return NULL;
    }
    static int ret[501];
    if (flag == 0)
    {
        *returnSize = 0; flag = 1; printf("hello\n");
    }
    inorderTraversal(root->left, returnSize);

    ret[(*returnSize)++] = root->val;

    inorderTraversal(root->right, returnSize);
    return ret;
}

int main()
{
	struct TreeNode T = { T.val = 1,T.left = NULL,T.right = NULL };
    struct TreeNode T2 = {2,NULL};
    struct TreeNode T3 = { 3,NULL,NULL };
    
    T.right = &T2;
    T2.left = &T3;
    int returnSize = 0;
    T.left = NULL;
    T.right = NULL;
    int* tmp = inorderTraversal(&T, &returnSize);
    for (int i = 0; i < returnSize; i++)
    {
        printf("%d ",tmp[i]);
    }

}